<template>
	<div style="height: 400px;border: 1px solid blue;">
		<h3>课程</h3>
		<table border="1">
			<tr><th>老师名字</th><th>班级名称</th><th>课程名称</th></tr>
			<tr v-for="x in data.courses">
				<td>{{x.user.uname}}</td>
				<td>{{x.clz.clzname}}</td>
				<td>{{x.course.cname}}</td>
			</tr>
		</table>
	</div>
</template>

<script setup>
	import {ref,reactive,onMounted} from 'vue';
	import {$get,$postx,$postf} from "../../ajax/index.js";
	import myalert from "../../utils/myalert.js";
	
	const data =reactive({
		courses:[],
	})
	/* 获取学生的数据 */
	onMounted(() => {
			$get("/api/fore/stu/findMyCourse")
				.then((reap) => {
					myalert("获取数据完毕.."+reap.data.data.length)
					console.log(reap.data.data[0]);
					data.courses = reap.data.data;
				})
		})
	
</script>

<style>
</style>
